package GUI;
import java.awt.Color;

import java.awt.Graphics;

import javax.swing.JPanel;
import composite.*;

/** Panel for drawing place. **/ 
@SuppressWarnings("serial")
public class DrawingPanel extends JPanel {
	private ObjectGroup rootGroup;
	
	public DrawingPanel() { 
	    setBackground(Color.WHITE);   
	}
	
	public void paintComponent(Graphics g){
		super.paintComponent(g); // Clear the panel before drawing
		rootGroup.drawObject(g);
	}
	
	public ObjectGroup getRootGroup() {
		return rootGroup;
	}
	public void setRootGroup(ObjectGroup rootGroup) {
		this.rootGroup = rootGroup;
	}
} // class DrawingPanel